import { history, setLocale } from '@umijs/max';
import { useEffect, useRef } from 'react';
import './index.less';
const Index = () => {
    const iframeRef = useRef(null);
    function toSystem() {
        history.push('/home');
    }
    useEffect(() => {
        //接受子页面传递过来的数据
        window.addEventListener(
            'message',
            function (event) {
                if (event.data.type === 'btnToSys') {
                    setLocale(event.data.locale === 'zh' ? 'zh-CN' : 'ru-RU',false);
                    toSystem();
                }
            },
            false,
        );
    }, []);
    return (
        <div className="indexWebDist">
            <iframe
                ref={iframeRef}
                className="iframe"
                src="https://web.gluz.com.cn/"
            ></iframe>
        </div>
    );
};
export default Index;
